<div class="paging">
{if $Paging.firstpage != $Paging.pages[0]}
{assign var='Page' value=$Paging.firstpage}
<a href="{eval var=$Link}" class="{if $Page eq $Paging.page}curr_page{else}page{/if}">{$Page}</a> ...
{/if}

{foreach from=$Paging.pages item="Page" name="pages"}
  <a href="{eval var=$Link}" class="{if $Page eq $Paging.page}curr_page{else}page{/if}">{$Page}</a>
{/foreach}

{if $Paging.lastpage != $Paging.pages[$smarty.foreach.pages.index]}
{assign var='Page' value=$Paging.lastpage}
 ... <a href="{eval var=$Link}" class="{if $Page eq $Paging.page}curr_page{else}page{/if}">{$Page}</a>
{/if}
</div>